<template>
    <el-row :gutter="20" class="top">
      <el-col :span="8">
        <el-card shadow="hover"> 回收答卷数 <span>{{ topTotal }}</span></el-card>
      </el-col>
      <el-col :span="8">
        <el-card shadow="hover"> 好以上占比率 <span>{{ topCstore }}</span></el-card>
      </el-col>
    </el-row>
</template>

<script setup>
import moment from 'moment'
import { getTotalCensusTopData } from '@/api/business/questions/statistics/StatisticConfig'
import { onMounted } from '@vue/runtime-core'
import { ref } from 'vue'

moment.locale('zh-cn')

const topTotal = ref('')
const topCstore = ref('')

const getTotalData = () => {
  const year = new Date().getFullYear()
  getTotalCensusTopData(year).then(data => {
    const { total, cstore } = data
    topTotal.value = total
    topCstore.value = cstore
  })
}

onMounted(() => {
  getTotalData()
})
</script>

<style scoped>
.top{
    padding:20px 20px 0px 20px;
}
span{
  font-weight: bold;
  font-size: large;
}
</style>
